<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<%--
  Created by IntelliJ IDEA.
  User: 24250
  Date: 2021/8/21
  Time: 9:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>天天生鲜-商品详情页</title>
    <link rel="stylesheet" href="../css/main1.css" media="all" >
    <link rel="stylesheet" href="../css/reset1.css" media="all" >
    <link rel="stylesheet" href="../css/index.css" media="all" >
    <script type="text/javascript" src="../js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="../js/jquery-ui.min.js"></script>
    <script type="text/javascript" src="../js/slide.js"></script>

    <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

    <style type="text/css">
        .div1{

                width:500px;
                height: 300px;
                left: 950px;
                top: 300px;
                position: absolute;
                background-color: #dddddd;
            }
        .div2{

                width:500px;
                height: 500px;
                left: 450px;
                top: 200px;
                position: absolute;
                background-color:#ff8800 ;
        }

        .aligncenter {
            clear: both;
            display: block;
            margin: auto;
        }

        /*购买样式*/

        .buy_btn,.add_cart{
            display:inline-block;
            width:178px;
            height:38px;
            text-align:center;
            border:1px solid #c40000;
            font-size:14px;
            color:#c40000;
            background-color:#ffeded;
        }

        /*单价*/
        .price_bar{
            height:72px;
            line-height:72px;
            background-color:#fff5f5;
        }
        .price_bar .show_price{
            font-size:20px;
            padding-left:20px;
        }
        .price_bar em{
            font-size:36px;
            color:#ff3e3e;
        }
        em{
            padding:0 10px;
        }
        .price_bar .show_unit{
            padding-left:150px;
        }
        /*底部*/
        .div3{
            width:1900px;
            height: 50px;
            left: 0px;
            top: 900px;
            position: absolute;
            text-align:center;
            background-color: #dddddd;
        }

    </style>

</head>
<body style="background-color: blanchedalmond">
         <%--头部--%>
         <div>
                 <div class="header_con">
                     <div class="header">
                         <div class="welcome fl">欢迎来到天天生鲜!</div>
                         <div class="fr">
                             <div class="login_btn fl">
                                 <span>欢迎您</span>
                                 <span>|</span>
                                 <a href="${pageContext.request.contextPath}/user/touserrecord" name="user_name">${sessionScope.username}</a>
                             </div>
                             <div class="user_link fl">
                                 <span>|</span>
                                 <a href="${pageContext.request.contextPath}/user/touserrecord">用户中心</a>
                                 <span>|</span>
                                 <a href="cart.html">我的购物车</a>
                                 <span>|</span>
                                 <a href="${pageContext.request.contextPath}/order/OrderList?user_id=${user_id}" target="_blank">我的订单</a>
                             </div>
                         </div>
                     </div>
                 </div>


        <%--搜索框和购物车选项--%>
             <div class="search_bar clearfix">
                 <a href="${pageContext.request.contextPath}/main/index" class="logo fl"><img src="../images/logo.png"></a>
                 <form action="${pageContext.request.contextPath}/product/search" method="post" class="search_con fl">
                     <input type="text" class="input_text fl" name="name" placeholder="显示全部商品">
                     <input type="submit" class="input_btn fr" value="搜索">
                 </form>
                 <div class="guest_cart fr">
                     <a href="#" class="cart_name fl">我的购物车</a>
                     <div class="goods_count fl" id="show_count">${number}</div>
                 </div>
             </div>
         </div>

         <div class="div2">
         <a href="${pageContext.request.contextPath}/product/id?id=${product_list.id}"><img src="../images/goods/${product_list.id}.png" width="495px" height="495px" class="aligncenter"></a><br>
        </div>
         <div class="div1">
         <font class="id" href="#"size="3">商品编号：${product_list.id}</font>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <font class="name" size="7" color="#a52a2a" >${product_list.name}</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <font class="sort2" size="6">${product_list.sort2}</font>
             <div class="price_bar">
                 <span class="show_price">￥<em>${product_list.price}</em>元</span>
                 <span class="show_unit">单位：<em>${product_list.weight}</em></span>
             </div>
         &nbsp;&nbsp;
         <span class="hot" >人气值:${product_list.popularity}</span>
             <div class="operate_btn">
                 <a href="javascript:;" class="buy_btn" id="buy_btn">立即购买</a>
                 &nbsp;
                 <form action="${pageContext.request.contextPath}/product/addProduct" method="post">
                     <input type="hidden" name="user_id" value="${user_id}">
                     <input type="hidden" name="product_id" value="${product_list.id}">
                     <input type="hidden" name="product_num" value="1">

                     <input type="submit" value="加入购物车" style="background-color: #ff8800;width: 200px;height: 50px" class="add_cart" id="add_cart">
                 </form>
             </div>
         </div>



         <script>
             //立即购买
             $("#buy_btn").click(function(){
                 // location.href = "order.html";
                 alert("请先加入购物车！");
             });
             //加入购物车
             $("#add_cart").click(function(){
                 alert("商品添加成功!");
             });
         </script>

         <!-- 版权所有 -->
         <div class="div3">
             <div>
                 <a href="https://www.ctgu.edu.cn/">关于我们</a> <span> | </span>
                 <a href="http://sxdxjwc.ctgu.edu.cn/index.jsp">联系我们</a> <span> | </span>
                 <a href="http://www.lxjx.cn/">招聘广告</a> <span> | </span>
                 <a href="https://www.baidu.com/">友情链接</a>
             </div>
             <p style="font-size: 20px">CopyRight &copy;2021宜昌市大威天龙科技有限公司 All Rights Reserverd</p>
             <p>电话：13666666666</p>
         </div>

</body>
</html>
